﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UploadPhoto.ascx.cs" Inherits="Besture.UI.Admin.Control.UploadPhoto1" %>
<link href="/JS/jquery.uploadify/uploadify.css" rel="stylesheet" type="text/css" />
<script src="/JS/jquery.uploadify/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/JS/jquery.uploadify/swfobject.js" type="text/javascript"></script>
<script src="/JS/jquery.uploadify/jquery.uploadify.v2.1.0.min.js" type="text/javascript"></script>
<script language="javascript">
    /*上传商品图片*/
    $(document).ready(function () {
        $("#lblDis").hide();
        /*模板图片控件*/
        $("#uploadify").uploadify({
            'uploader': '/JS/jquery.uploadify/uploadify.swf',
            'script': '/Admin/Control/UploadPhoto.aspx',
            'scriptData': { 'PID': "" },
            'fileDataName': "ProductPhotoFile",
            'cancelImg': '/JS/jquery.uploadify/cancel.png',
            'folder': '/Upload/',
            'queueID': 'fileQueue',
            'auto': true,
            'multi': true,
            'filedesc': '支持JPG|GIF|PNG|图片格式',
            'fileExt': '*.JPG,*.GIF,*.PNG',
            'buttonImg': '/Admin/Themes/Images/scmb.png',
            'width': 90,
            'height': 23,
            'simUploadLimit': 1,
            'wmode': 'transparent',
            onComplete: function (event, queueID, fileObj, serverData, data) {
                if (fileObj == "0") {
                    alert("网络异常，上传失败！");
                } else {
                    $("#<%=UploadPhotoUrl.ClientID%>").val(serverData);
                    $("#lblDis").val("图片上传成功");
                    $("#lblDis").show();
                }

            }
        });
    });
</script>
<asp:TextBox runat="server" ID="UploadPhotoUrl"  style="display:none"></asp:TextBox>
<!--上传模板图片控件-->
<div class="ys_bf_bj">
    <div id="fileQueue" style="width: 100%">
    </div>
    <!--上传模板图片控件-->
    <input type="file" name="uploadify" id="uploadify" />&nbsp;
</div>
<label  ID="lblDis" Width="200" Height="22"></label>